package org.security.handler.filter;

import org.security.handler.AfterFilterHandler;
import org.security.util.RequestUtil;
import org.security.util.XssUtil;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author jt
 * @date 2024/7/19 22:00
 */
@Component
public class XssHandler implements AfterFilterHandler {

    @Override
    public Integer getIndex() {
        return 2;
    }

    @Override
    public String getName() {
        return "XssHandler";
    }

    @Override
    public void doFilter(HttpServletRequest request, HttpServletResponse response) {

//        String body = XssUtil.stripXss(RequestUtil.bodyToStr(request));
        // TODO: 2024/7/22 body赋值给request中 

    }
}
